#include <iostream>
#include "Riven.h"
#include "Rammus.h"
#include "DoransShield.h"
#include "DoransBlade.h"
#include "Hero.h"

using namespace std;

int main(){

	Hero* heros[2];
	heros[0] = new Rammus;
	heros[1] = new Riven;

	heros[0] -> addItem(new DoransShield);	
	heros[0] -> addItem(new DoransShield);
	heros[0] -> addItem(new DoransShield);
	heros[0] -> addItem(NULL);
	heros[0] -> addItem(new DoransShield);
	heros[0] -> addItem(new DoransBlade);
	heros[0] -> addItem(new DoransBlade);
	heros[0] -> addItem(NULL);

	heros[1] -> addItem(new DoransShield);
	heros[1] -> addItem(new DoransShield);
	heros[1] -> addItem(new DoransBlade);
	heros[1] -> addItem(NULL);
	heros[1] -> addItem(new DoransBlade);
	heros[1] -> addItem(new DoransBlade);
	heros[1] -> addItem(new DoransBlade);
	heros[1] -> addItem(NULL);

	while(1){
		heros[0] -> action();
		heros[1] -> action();
		heros[0] -> decreaseHP((heros[1] -> getAD() - heros[0] -> getDefense()));	
		
		if(heros[0] -> getHP() <= 0){
			break;
		}
		heros[1] -> decreaseHP((heros[0] -> getAD() - heros[1] -> getDefense()));
		if(heros[1] -> getHP() <= 0){
			break;
		}
	}

	std::cout << heros[0] -> getName() << " HP: " << heros[0] -> getHP() << " " << heros[1] -> getName() << " HP: " << heros[1] -> getHP() << std::endl;

	delete heros[0];
	delete heros[1];
	return 0;
}
